﻿package frEngine.loaders.away3dMd5
{
    import baseEngine.core.*;
    import flash.geom.*;

    public class AnimationClipNodeBase extends Label3D
    {
        protected var _lastFrame:uint;
        protected var _stitchDirty:Boolean = true;
        protected var _stitchFinalFrame:Boolean = false;
        public var numFrames:uint = 0;
        protected var _totalDelta:Vector3D;
        public var fixedFrameRate:Boolean = true;

        public function AnimationClipNodeBase(param1:int, param2:int, param3:String, param4:uint, param5:uint)
        {
            this._totalDelta = new Vector3D();
            super(param1, param2, param3, param4);
            this.numFrames = param5;
            return;
        }// end function

        public function get stitchFinalFrame() : Boolean
        {
            return this._stitchFinalFrame;
        }// end function

        public function set stitchFinalFrame(param1:Boolean) : void
        {
            if (this._stitchFinalFrame == param1)
            {
                return;
            }
            this._stitchFinalFrame = param1;
            this._stitchDirty = true;
            return;
        }// end function

        public function get totalDelta() : Vector3D
        {
            if (this._stitchDirty)
            {
                this.updateStitch();
            }
            return this._totalDelta;
        }// end function

        public function get lastFrame() : uint
        {
            if (this._stitchDirty)
            {
                this.updateStitch();
            }
            return this._lastFrame;
        }// end function

        protected function updateStitch() : void
        {
            this._stitchDirty = false;
            this._lastFrame = this._stitchFinalFrame ? (this.numFrames) : ((this.numFrames - 1));
            this._totalDelta.x = 0;
            this._totalDelta.y = 0;
            this._totalDelta.z = 0;
            return;
        }// end function

    }
}
